home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
utils
/
filestuf.lzh
/
EXAMPLE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1990-08-22
|
4KB
|
174 lines
;First thing to do here is clear the screen so we start out nice. :-)
s E
s
s p Filestuff Example Script q
s
s
s Ok, let's go on a quick tour! First, we'll see how to check for a particular
s keypress. When I say so, you press a key and I'll tell you which one it was.
s For this demo, I'll only check for the first three letters, numbers, and
s function keys, the ESCape key, and the "special" keys.
s
b
p 15
@ 3
buffer
s All set? Ok, press a key within 15 seconds!
pause 15
s
keyget
ifkey 1 11 numbers...
i 2 12
i 3 13
i 14 note: there's an ESC between "i" and "14" here!
i a 15 letters...
i A 16
i b 17
i B 18
i c 19
i C 20
i /1 21 function keys...
i /2 22
i /3 23
i /help 24 special keys...
i /return 25
i /space 26
i /undo 27
i /any 28
i /none 29
s
s I check for both "any key" and "no key" above, so you shouldn't ever
s see this message! If you do, something's not right!
j 30
@ 11
s You pressed p 1 q!
j 30
@ 12
s You pressed p 2 q!
j 30
@ 13
s You pressed p 3 q!
j 30
@ 14
s You pressed the p ESC q key!
j 30
@ 15
s You pressed p a q!
j 30
@ 16
s You pressed p shift-A q!
j 30
@ 17
s You pressed p b q!
j 30
@ 18
s You pressed p shift-B q!
j 30
@ 19
s You pressed p c q!
j 30
@ 20
s You pressed p shift-C q!
j 30
@ 21
s You pressed p F1 q!
j 30
@ 22
s You pressed p F2 q!
j 30
@ 23
s You pressed p F3 q!
j 30
@ 24
s You pressed p Help q!
j 30
@ 25
s You pressed p Return q or p Enter q!
j 30
@ 26
s You pressed the p space bar q!
j 30
@ 27
s You pressed p Undo q!
j 30
@ 28
s You pressed p some other key q!
j 30
@ 29
v +
s You didn't press any key at all!
v -
;
@ 30 This is the end of the keypress test.
;
s
s If you want to try again, press the p space bar q within 10 seconds.
s Otherwise we'll go on to something else.
buffer
pause 10
ketget
s
i /s 3 (go back for more key testing)
;---------------------------
s Ok, here's something else...
hirez 35
medrez 36
lowrez 37
s You're not in low, medium, or high rez... got a Moniterm, maybe?
j 38
@ 35
s You're running in monochrome right now!
j 38
@ 36
s You're running in medium rez right now!
j 38
@ 37
s You're running in low rez right now!
@ 38
s
s Filestuff can determine what resolution your ST is in, and branch to a
s particular label depending on what rez it is. This could be useful if a
s program you want to run needs different configuration files for each rez.
s
b
p 10
;---------------------------
s Ok, now that that's done let me show you some of the things you can do
s using the SHOW command. You can use the VIDEO command to...
video +
s
s turn reverse video on (with "VIDEO +" or "V +")...
;
;Note: there's a TAB character between the "s" and the "turn" above...
;Tabs only move the cursor (they aren't really "displayed"), so they
;don't show up when you're in reverse video. The title uses tabs too.
;
v -
s
s or turn reverse video back off (with "VIDEO -" or "V -").
b
p 10
s
s You can also embed VT-52 control codes in a SHOW command. That's how I
s cleared the screen above - I included an p ESC-E q in my SHOW. You could also
s embed p ESC-p q to switch reverse video on, or p ESC-q q to turn it off; it's
s a handy way of highlighting important information. Other VT-52 codes will
s work too.
b
p 15
;---------------------------
s
s That's the end of this example script; now we'll Transfer control to our
s second example to demonstrate the File Commands. When we transferred to
s this script, recall that the actual command line was displayed on screen.
s If you wish, you can disable this command line 'echo' and display a more
s informative message - all it takes is the "ECHO -" command. I'll disable
s the echo now, and move on to the next script...
s
b
p 15
echo -
b
s Transferring control to second example...
t \example2.cmd -- Transfer control to our second example script...